Unit testing is often performed on software to ensure certain functionality and/or performance. For example, a technology developer may perform unit testing on an application and/or a patch to ensure suitable functionality and/or performance prior to release. Accordingly, unit testing may facilitate detecting bugs within software. However, while traditional unit testing has proven helpful in detecting software bugs in many contexts, such unit testing may still have certain deficiencies that limit its applicability and/or effectiveness in other contexts.
As a specific example, a technology developer may develop a network Operating System (OS) for certain network devices (such as routers and/or switches). In this example, the technology developer may implement certain traditional unit testing tools in user space to test the kernel of the network OS during deployment. Unfortunately, such traditional unit testing tools may be unable to facilitate testing of individual kernel functions with specific parameters. This inability to facilitate such testing may derive at least in part from the kernel functions' definitions, which call for and/or expect parameters to be passed by reference. In other words, the kernel functions may call for and/or expect parameters residing in kernel space to be passed as arguments by their respective addresses, which are not visible and/or known to the traditional unit testing tools in user space.
In another traditional approach, the technology developer may be able to write test scripts that facilitate testing of individual kernel functions and/or their parameters within the kernel itself. Unfortunately, to carry out this type of testing, the technology developer may need to link these scripts with the kernel, thereby potentially bloating the kernel, changing the kernel's behavior, causing the kernel to perform poorly or inefficiently, or even halting the kernel.
The instant disclosure, therefore, identifies and addresses a need for systems and methods for unit testing of operating system kernels from user space.